package pers.cz.logtail.balance;

import java.util.List;
import java.util.Random;

/**
 * @program: JefLogTail
 * @description: 随机负载均衡
 * @author: Cheng Zhi
 * @create: 2023-10-05 09:40
 **/
public class RandomLoadBalance implements LoadBalance {

    @Override
    public String balance(List<String> addressList) {
        Random random = new Random();
        int choose = random.nextInt(addressList.size());
        return addressList.get(choose);
    }
}
